home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 1999 January / CD Rom Data Ocak 1999.iso / Xtras / QT3 Behavior Library.cst / 00012_SetScale.ls < prev    next >
Encoding:
Text File  |  1998-04-19  |  1.8 KB  |  80 lines

  1. -- SetScale
  2.  
  3. --Set a QT3 sprite's scale to some value 
  4. --
  5. --PARAMETERS 
  6. --Scale:  Amount to scale the sprite.
  7.  
  8. property xScale, yScale, pWhichEvent
  9.  
  10. on doit me
  11.   set the crop of member the member of sprite the spriteNum of me = false
  12.   set the scale of sprite the spritenum of me to [xScale, yScale]
  13.   set bFirstFrame = false
  14. end
  15.  
  16. on beginSprite me
  17.   if the pWhichEvent of me = #beginSprite then doIt me
  18. end
  19.  
  20. on mouseUp me
  21.   if the pWhichEvent of me = #mouseUp then doIt me
  22. end
  23.  
  24. on mouseDown me
  25.   if the pWhichEvent of me = #mouseDown  then doIt me
  26. end
  27.  
  28. on mouseWithin me
  29.   if the pWhichEvent of me = #mouseWithin  then doIt me
  30. end
  31.  
  32. on prepareFrame me
  33.   if the pWhichEvent of me = #prepareFrame then doIt me
  34. end
  35.  
  36. on mouseEnter me
  37.   if the pWhichEvent of me = #mouseEnter then doIt me
  38. end
  39.  
  40. on mouseLeave me
  41.   if the pWhichEvent of me = #mouseLeave then doIt me
  42. end
  43.  
  44. on enterFrame me
  45.   if the pWhichEvent of me = #enterFrame then doIt me
  46. end
  47.  
  48. on exitFrame me
  49.   if the pWhichEvent of me = #exitFrame  then doIt me
  50. end
  51.  
  52. on getPropertyDescriptionList
  53.   
  54.   set p_list = [ ┬¼
  55.    #xScale: [ #comment:  "X-Scale:", ┬¼
  56.              #format:   #float, ┬¼
  57.              #default:   100.0 ], ┬¼
  58.    #yScale: [ #comment:  "Y-Scale:", ┬¼
  59.              #format:   #float, ┬¼
  60.              #default:   100.0 ] ,┬¼
  61.   #pWhichEvent: [ #comment:   "Initializing Event:",┬¼
  62.                   #format:    #symbol,┬¼
  63.                   #range:    [#mouseUp, #mouseDown, #mouseWithin, #mouseEnter, ┬¼
  64.                               #mouseLeave, #prepareFrame, #enterFrame, #exitFrame,┬¼
  65.                               #beginSprite ],  ┬¼
  66.                  #default:   #beginSprite ]   ┬¼
  67.                ]
  68.   return p_list  
  69.   
  70. end
  71. on getBehaviorDescription
  72.   return ┬¼
  73. "Set a QT3 sprite's scale to some value" && RETURN & RETURN &┬¼
  74. "PARAMETERS" && RETURN &┬¼
  75. "Scale:  Amount to scale the sprite."
  76.   
  77. end
  78.  
  79.  
  80.